package practise.leetcode.q11;

public class Solution {
    public int maxArea(int[] height) {
        int len = height.length;

        int max = 0;
        for (int left = 0; left < len - 1; left++) {
            for (int right = left + 1; right < len; right++) {
                int result = (right - left) * Math.min(height[left], height[right]);
                if (result > max) {
                    max = result;
                }
            }
        }
        return max;
    }
}
